/**
 * Copyright (c) 2018-2025, zening (316279828@qq.com).
 * <p>
 * Any unauthorised copying, selling, transferring, distributing, transmitting, renting,
 * or modifying of the Software is considered an infringement.
 */
package com.baomibing.web.config;

/**
 * WebMvc 通用配置类
 * 
 * @author zening
 * @since 1.0.0
 */
//@ConditionalOnProperty(prefix = "spring.mvc", name = "enabled", havingValue = "true", matchIfMissing = true)
//@Configuration
public class MvcConfigurer //implements WebMvcConfigurer
{

//	@Autowired
//	private MappingJackson2HttpMessageConverter jacksonMessageConverter;
//	@Autowired
//	private StringHttpMessageConverter stringMessageConvert;
//
//	@Bean
//	public ContextHandlerInterceptor contextInterceptor() {
//		return new ContextHandlerInterceptor();
//	}
//
////	@Bean
////	public TenantHandlerInterceptor tenantInterceptor() {
////		return new TenantHandlerInterceptor();
////	}
//
//	@Bean
//	public ReturnHandlerAdvice returnHandlerAdvice() {
//		return  new ReturnHandlerAdvice();
//	}
//
//	@Bean
//	public GlobalExceptionHandler globalExceptionHandler() {
//		return new GlobalExceptionHandler();
//	}
//
//	@Override
//	public void addInterceptors(InterceptorRegistry registry) {
//		registry.addInterceptor(contextInterceptor()).excludePathPatterns(Lists.newArrayList("/activiti/**"))
//				.addPathPatterns("/**").order(-1);
//
////		registry.addInterceptor(tenantInterceptor()).excludePathPatterns(Lists.newArrayList("/activiti/**"))
////				.addPathPatterns("/**").order(1);
//	}
//
//	@Override
//	public void addResourceHandlers(ResourceHandlerRegistry registry) {
//		registry.addResourceHandler("/**").addResourceLocations("classpath:/static/");
//	}
//
//	@Override
//	public void addFormatters(FormatterRegistry registry) {
//		registry.addConverter(new Date2StringConverter());
//		registry.addConverter(new LocalDate2StringConverter());
//		registry.addConverter(new LocalDateTime2StringConverter());
//		registry.addConverter(new LocalTime2StringConverter());
//		registry.addConverter(new String2DateConverter());
//		registry.addConverter(new String2LocalDateConverter());
//		registry.addConverter(new String2LocalDateTimeConverter());
//		registry.addConverter(new String2LocalTimeConverter());
//	}
//
//	@Override
//	public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
//		converters.add(jacksonMessageConverter);
//		converters.add(stringMessageConvert);
//	}
//
//	@Bean
//	public LocalValidatorFactoryBean validatorFactoryBean() {
//		LocalValidatorFactoryBean bean = new LocalValidatorFactoryBean();
//		bean.getValidationPropertyMap().put("hibernate.validator.fail_fast", "true");
//		bean.setValidationMessageSource(messageSource());
//		return bean;
//	}
//
//	@Bean
//	public MessageSource messageSource() {
//		ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
//		messageSource.setBasename("classpath:Validation");
//		messageSource.setDefaultEncoding("UTF-8");
//		messageSource.setUseCodeAsDefaultMessage(false);
//		messageSource.setCacheSeconds(60);
//		return messageSource;
//	}
//
//	@Bean
//	public LocaleResolver localeResolver() {
//		SessionLocaleResolver localeResolver = new SessionLocaleResolver();
//		// 指定默认语言为中文
//		localeResolver.setDefaultLocale(Locale.SIMPLIFIED_CHINESE);
//		return localeResolver;
//	}
//
//	@Bean
//	@ConditionalOnClass(Undertow.class)
//	public UndertowServerFactoryCustomizer getUndertowServerFactoryCustomizer() {
//		return new UndertowServerFactoryCustomizer();
//	}

}
